<%* page2.tpl --- Smarty template for second page of Ballot object test *%>

<%if $noBallot %>

<%include file="header.tpl" title="No Ballot" heading="No Current Ballot"%>
     <p>No current ballot is available for the zipcode you entered</p>

     <form method="link" action="index.php"> <input type="submit" value="Back To Start"></form>

<% elseif $needPlus4 %>

<%include file="header.tpl" title="Need Zip Plus 4" heading="Need Zip Plus 4"%>
<div>
	<form method = "post" action="page2.php">
		<table>
		<tr><td>The zipcode you entered contains more than one voting district.</td></tr>

		<tr><td>Please enter your 4 digit zip+4 number to determine your correct district:</td>
		<td><input type="text" name="plus4"></input></td>
		</tr>
		<tr><td colspan="2" align="center">
		<input type="submit" value="Submit"></input></td>
		</tr></table></form>
		<form method="link" action="index.php"> <input type="submit" value="Back To Start"></form>
</div>
<%else%><!-- all is good, display ballot -->
     <%include file="header.tpl" title="Sample Ballot" heading="Sample Ballot"%>
     <form name="ballot" method="POST" action="page3.php" accept-charset="iso-8859-1">
    <link rel="stylesheet" href="../../lib/WordCloud/css/wordcloud.css" type="text/css">

     <h3>Sample ballot for zip code: <% $smarty.session.myZip %>
     <% if isset($smarty.session.plus4) %>
	  - <% $smarty.session.plus4 %>
     <% /if %>
     </h3>
     <h3>Your voting date is <% $voteDate %></h3>
     <%if !$noElect %>
	 <hr>
	 <table width="100%" border="0" cellspacing="5" cellpadding="3">


	  <%foreach from=$elections item=elect %>
	  <tr><td style="border-bottom: 1px #999999 solid" colspan="2"><h1><%$elect->electionName%> <%$elect->stageName%> Election
	  </h1></td></tr>
	  <tr><td width = "50%"><table width="100%" border="0" cellspacing="5" cellpadding="3">
	     <% foreach from=$elect->offices key=oname item=ofc %>
	       <tr><td width="20%"><h3><%$oname%>: </h3></td>
	       <td>&nbsp;</td>
	      <td>&nbsp;</td>
	       </tr>
	       <% foreach from=$ofc item=cand %>
		    <tr ><td >&nbsp;</td>
		    <td style="border-bottom: 1px #999999 solid">
			 <input id="<% $cand->lastName %>" name="office-<% $oname %>-name-<% $cand->firstName %>-<% $cand->lastName %>" type="checkbox">
		    </td>
		    <td style="border-bottom: 1px #999999 solid" ><% $cand->firstName %>  <% $cand->middleName %>
			 <%if strlen($cand->nickName) > 0 %>
			      "<% $cand->nickName %>"
			 <%/if %>
			 <% $cand->lastName %> - <span style="font-size: smaller"><% $cand->party %></span></td></tr>
	       <%/foreach%>
	     <%/foreach%>
	     </table>
	     </td></tr>
	     </table>

	  <%/foreach%><!--end elections -->
	  </table>

     <% else %>
	  <hr>
	  <h3>No offices are up for election on this ballot.</h3>
     <% /if %>
     <% if !$noMeas %>
	  <hr>
	  <h2>Ballot Measures</h2>
	  <ul>

	  <%foreach from=$measures item=meas%>
	       <li><h3><% $meas->measureCode %></h3></li>
	       <ul>
	       <li><% $meas->measureTitle %>  <input id="<% $meas->measureCode %>" name="measure-<% $meas->measureTitle %> " type="checkbox"></li></ul>
	 <%/foreach%>
	 </ul>
     <% else %>
	  <hr>
	  <h3>There are no measures on this ballot.</h3>
     <%/if%>


<hr>


     <p>Get search tag clouds for selected:
     <input type="submit" name="Submit" value="Search Clouds">

     </p>
     <p>Get issue tag clouds for selected:
     <input type="submit" name="Submit3" value="Issue Clouds">

     </p>
     </form>
     <form method="link" action="index.php"> <input type="submit" value="Back To Start"></form>
<%/if%>

	  <%foreach from=$distOfc key=oname item=ofc%>
	       <li><h3><% $oname %></h3></li>
	       <ul>
	       <li><% $ofc %> </ul>
	 <%/foreach%>
	 
<?php print_r($_SESSION['distOfc'])?>

<%include file="footer.tpl"%>